ClientForm = Ext.extend(Ext.FormPanel, {
    // Prototype Defaults, can be overridden by user's config object
    labelAlign: 'top',
    frame: true,
    //title: 'Construction Impact Form',
    bodyStyle: 'padding:5px 5px 0',
    width: 300,
	defaults: {width: 230},
    autoScroll: true,
    reader: new Ext.data.JsonReader({
        root: 'record',
        fields: ['client_id', 'client_name', 'phone','client_addr','ctime', 'mtime']
    }),
    
    
    initComponent: function(){
        // Called during component initialization
        
        // Config object has already been applied to 'this' so properties can 
        // be overriden here or new properties (e.g. items, tools, buttons) 
        // can be added, eg:
        /*
         Ext.apply(this, {
         propA: 3
         });*/
        // Before parent code
        //items has to be add here, because otherwise it will messup the FormPanel.items property
        Ext.apply(this, {
            items: [{
                xtype: 'textfield',
                fieldLabel: 'client_id',
                name: 'client_id',
                hidden: true,
                hideLabel: true,
                width: 100,
                allowBlank: true
            }, {
                xtype: 'textfield',
                fieldLabel: 'Client',
                name: 'client_name',
                hidden: false,
                hideLabel: false,
                width: 200,
                allowBlank: false
            }, {
                xtype: 'textfield',
                fieldLabel: 'Phone',
                name: 'phone',
                hidden: false,
                hideLabel: false,
                width: 200,
                allowBlank: true
            }, {
                xtype: 'textarea',
                fieldLabel: 'Address',
                name: 'client_addr',
                hidden: false,
                hideLabel: false,
                width: 200,
                allowBlank: true
            }, {
                xtype: 'datefield',
                fieldLabel: 'ctime',
                name: 'ctime',
                hidden: true,
                hideLabel: true,
                width: 200,
                allowBlank: true
            }, {
                xtype: 'textfield',
                fieldLabel: 'mtime',
                name: 'mtime',
                hidden: true,
                hideLabel: true,
                width: 200,
				
                allowBlank: true
            }]
        });
        
        // Call parent (required)
        ClientForm.superclass.initComponent.apply(this, arguments);
        
        // After parent code
        // e.g. install event handlers on rendered component
    },
    
    // Override other inherited methods 
    onRender: function(){
    
        // Before parent code
        
        // Call parent (required)
        ClientForm.superclass.onRender.apply(this, arguments);
        // After parent code
    
    
    }
});

// register xtype to allow for lazy initialization
Ext.reg('clientform', ClientForm);
